home *** CD-ROM | disk | FTP | other *** search
/ Champak 29 / Volume 29 - JOGO DISK .iso / Games / jungle_adventure.swf / scripts / __Packages / SSZone.as < prev    next >
Text File  |  2006-11-29  |  1KB  |  55 lines

  1. class SSZone extends SSObject
  2. {
  3.    static var SPHERE = 0;
  4.    static var RECT = 1;
  5.    var assetID = null;
  6.    var boundType = SSZone.SPHERE;
  7.    var classID = SSGlobal.CLSID_ZONE;
  8.    var editor_canChangeAsset = false;
  9.    var editor_canChangeLayer = false;
  10.    var editor_canChangeFrame = false;
  11.    function SSZone(type, size, onCollision, ownerObject)
  12.    {
  13.       super();
  14.       if(arguments.length)
  15.       {
  16.          this.init.apply(this,arguments);
  17.       }
  18.    }
  19.    function init(type, size, onCollision, ownerObject)
  20.    {
  21.       if(this.boundType = type)
  22.       {
  23.          if(size)
  24.          {
  25.             this.localTop = this.localLeft = 0;
  26.             this.localRight = size.x;
  27.             this.localBottom = size.y;
  28.          }
  29.          else
  30.          {
  31.             this.localTop = this.localLeft = 0;
  32.             this.localRight = this.localBottom = 100;
  33.          }
  34.       }
  35.       else
  36.       {
  37.          if(size)
  38.          {
  39.             this.radius = size;
  40.          }
  41.          this.localTop = this.localLeft = - (this.localRight = this.localBottom = this.radius);
  42.       }
  43.       if(onCollision)
  44.       {
  45.          this.onColMethod = onCollision;
  46.       }
  47.       this.owner = ownerObject;
  48.       this.args = arguments.slice(4);
  49.    }
  50.    function onCollision(obj)
  51.    {
  52.       return this.onColMethod.call(this.owner,obj);
  53.    }
  54. }
  55.